﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace AHC
{
    public partial class SettingsForm : Form
    {
        public SettingsForm()
        {
            InitializeComponent();

            textBoxSettingsGamePath.Text = Utils.ReadConfig();
        }

        private void buttonBrowseFolder_Click(object sender, EventArgs e)
        {
            folderBrowserDialog.InitialDirectory = Application.StartupPath.ToString();

            if (folderBrowserDialog.ShowDialog() == DialogResult.OK)
            {
                textBoxSettingsGamePath.Text = folderBrowserDialog.SelectedPath;
            }
        }

        private void buttonSettingsConfirm_Click(object sender, EventArgs e)
        {
            Utils.WriteConfig(folderBrowserDialog.SelectedPath);
            Close();
        }

        private void buttonSettingsCancel_Click(object sender, EventArgs e)
        {
            Close();
        }
    }
}
